﻿using BarrageGameAssistant.Core.Configs;
using BarrageGameAssistant.Core.Model;
using ImageProcess;

namespace BarrageGameAssistant.Core.Engines
{
    /// <summary>
    /// 场景识别引擎
    /// </summary>
    public class KMActionEngine
    {
        private OcrHelper _ocr;
        private readonly Settings _settings;
        private GameProject? _currentGame;
        private Scene? _currentScene;



        /// <summary>
        /// 引擎是否运行中
        /// </summary>
        public bool IsRunning { get; private set; }

        /// <summary>
        /// 当前场景
        /// </summary>
        public Scene? CurrentScene { get; private set; }

        /// <summary>
        /// 场景发生变化事件
        /// </summary>
        public event EventHandler<Scene>? SceneChanged;

        public KMActionEngine(Settings settings)
        {
            _settings = settings;
            _ocr = new OcrHelper();
           
        }
        

        /// <summary>
        /// 设置当前游戏
        /// </summary>
        /// <param name="game"></param>
        public void SetCurrentGame(GameProject game) 
        {
            this._currentGame = game;
        }

        /// <summary>
        /// 设置当前场景
        /// </summary>
        /// <param name="scene"></param>
        public void SetCurrentScene(Scene scene)
        {
            this._currentScene = scene;
        }

        /// <summary>
        /// 启动
        /// </summary>
        public void Start()
        {
            IsRunning = true;
        }

        /// <summary>
        /// 停止
        /// </summary>
        public void Stop() 
        {
            IsRunning = false;
        }
    }
}
